﻿namespace ConsoleApp.Attribute;


/// <summary>
///     Readonly 属性
///         - Readonly 只能在构造函数中进行赋值，并且可以多次复制，但是只要出了构造函数
/// </summary>
public class ReadonlyAttribute
{
    public class Stu01
    {
        public readonly int Num;

        public static readonly int Num1;
        // 测试
        static Stu01()
        {
            Stu01.Num1 = 10;
            Stu01.Num1 = 20;
        }
        
        public Stu01()
        {
            Num = 10;
            Num = 20;
        }
    }
}
